//
//  UFOInfoViewController.m
//  unrivalledForUniverse
//
//  Created by dllo on 16/1/21.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "UFOInfoViewController.h"
#import "UFOInfoView.h"
@interface UFOInfoViewController ()<UIImagePickerControllerDelegate,UINavigationControllerDelegate,UFOInfoViewDelegate>
@property (nonatomic, retain) UITapGestureRecognizer *tapGR;
@property (nonatomic, retain) UFOInfoView *addV;
@end

@implementation UFOInfoViewController
- (void)dealloc
{
    [_tapGR release];
    [_addV release];
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.addV = [[UFOInfoView alloc] initWithFrame:self.view.frame];
    self.addV.delegate = self;
    [self.view addSubview:self.addV];
    [_addV release];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(135 * SCREENWIDTH / WIDTHSIXP, 15 * SCREENHEIGHT / HEIGHTSIXP, 100 * SCREENWIDTH / WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP)];
    label.text = @"个人信息";
    label.textColor = [UIColor purpleColor];
    label.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:label];
    [label release];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(10 * SCREENWIDTH / WIDTHSIXP, 10 * SCREENHEIGHT / HEIGHTSIXP, 50 * SCREENWIDTH / WIDTHSIXP, 50 * SCREENHEIGHT / HEIGHTSIXP);
    [button setImage:[UIImage imageNamed:@"fanhui232"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];

    
}

- (void)buttonAction
{

    [self dismissViewControllerAnimated:YES completion:^{
        
        
    }];
}

- (void)headerImageHandle
{
    // 进入系统相册
    UIImagePickerController *imagePC = [[UIImagePickerController alloc] init];
    imagePC.delegate = self;
    [self presentViewController:imagePC animated:YES completion:^{
        
        
    }];
    [imagePC release];
}

// 选好图片触发
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info;
{
    self.addV.imageV.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
    
    [self dismissViewControllerAnimated:YES completion:^{
        
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
